<script>
import data from "../packages/data.json"
import { provide, ref } from 'vue';
import Editor from "@/packages/editor.jsx"
import { registerConfig as config } from "../utils/editor-config";
export default {
  components: { Editor },
  setup() {
    //state.value
    const state = ref(data);
    //直接将组件配置从最顶部往下传递
    provide("config", config);
    //表单数据统一村到这里
    //如果非表单页面，例如宣传页就不需要，定制页面按照企业秀的分类，有广告页，表单页。。的区分
    const formData = ref({
      usename: "abcd",
      password: 123
    });
    console.log("formData",formData)
    return {
      state,
      formData
    }
  }
}
</script>

<template>
  <div class="app">
    <Editor v-model="state" :formData="formData" />
    <p style="position: fixed;bottom:0;z-index:9999">{{ JSON.stringify(formData) }}</p>
  </div>
</template>
<style lang="scss">
.app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;


}
</style>
